package com.love;


public class JumpGeZi {



    public static int maxScore(int[] nums){
        if (nums.length == 0) {
            return 0;
        }
        int N = nums.length;
        int[] dp = new int[N + 1];
        dp[0] = 0;
        dp[1] = nums[0];

        for (int k = 3; k <= N; k++) {
            dp[k] = Math.max(dp[k-1],dp[k-2] + nums[k-1] );
        }
        return dp[N];

    }


    public static void main(String[] args) {
        int[] ram = {1,2,3,1};
        System.out.println(maxScore(ram));
    }

}
